package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description：
 * User：user
 * DATE:2021-10-29
 * Time:17:15
 */
abstract  class  Shape{
    public abstract  void draw();
//    public final abstract  void draw2();
//    private abstract  void draw3();
//    public  static abstract  void draw4();
}
abstract  class A extends  Shape{
    public  abstract  void funcA();
}
class B extends  A{
    @Override
    public void draw() {
        System.out.println("B");
    }

    @Override
    public void funcA() {
        System.out.println("  dde1");
    }
}
/*abstract  class  Shape{
    public int age;
    public static int a;
    public void func(){
        System.out.println("faff");
    }
    public Shape(){

    }
    public abstract  void draw();
}*/
//抽象类和下面的普通类功能等价
/*class Shape{
    public  void draw(){
    }
}*/
class Cycle extends  Shape{
    @Override
    public void draw() {
        System.out.println("cycle");
    }
}
class Rect extends  Shape{
    //ctrl + i 实现抽象方法
    @Override
    public void draw() {
        System.out.println("rect");
    }
}
public class Test {
    public  static  void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        drawMap(new Cycle());
        drawMap(new Rect());
        //Shape shape = new Shape();
        //错误写法，抽象类不可以被实例化
    }
}
